package com.gzhryc.shared_device.oem.code.place.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.oem.code.user.ERoleType;
import com.gzhryc.shared_device.oem.code.user.dao.db.User;

import java.util.Date;

/**
 * 网点分成用户
 * @version 2023-03-12
 */
@Table(name="place_profit_user")
public class PlaceProfitUser {

    @PrimaryKey
    @Column(name = "place_id",notNull = true,note = "网点ID")
    protected Long placeId;

    @PrimaryKey
    @Column(name = "user_id",notNull = true,note = "用户ID")
    protected Long userId;

    @Column(name = "place_user_id",notNull = true,note = "网点用户ID")
    protected Long placeUserId;

    @Column(name = "role_type",notNull = true,defVal = "2",note = "角色，默认：商户")
    protected Integer roleType;

    @Column(note = "分成描述")
    protected String note;

    @Column(name = "income_ratio_content",type="TEXT",note = "分成比例")
    protected String incomeRatioContent;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Join(fromField = "user_id")
    protected User user;

    public Long getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getPlaceUserId() {
        return placeUserId;
    }

    public void setPlaceUserId(Long placeUserId) {
        this.placeUserId = placeUserId;
    }

    public String getIncomeRatioContent() {
        return incomeRatioContent;
    }

    public void setIncomeRatioContent(String incomeRatioContent) {
        this.incomeRatioContent = incomeRatioContent;
    }

    public Integer getRoleType() {
        return roleType;
    }

    public void setRoleType(Integer roleType) {
        this.roleType = roleType;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getRoleTypeName(){
        return ERoleType.note(this.roleType);
    }
}
